import Vue from "vue";
import Router from "vue-router";
import DataManagement from "./dataManagement";
import SystemManagement from "./systemManagement";
import EquipmentMaintenance from "./equipmentMaintenance";
import ManufacturerEquipment from "./manufacturerEquipment"
Vue.use(Router);

// 后台公共布局模块
const ContainerBackstage = () =>
  import(/* webpackChunkName: "Container" */ "../components/Container/ContainerBackstage.vue");
const Page404 = () =>
  import(/* webpackChunkName: "404" */ "../views/404/404.vue");
const Login = () =>
  import(/* webpackChunkName: "Login" */ "../views/Login/Login.vue");

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/monitoringData",
      show: false
    },
    {
      path: "/dataManagement",
      component: ContainerBackstage,
      show: true,
      list: true,
      meta: {
        title: "数据管理",
        roles: ["admin"],
        icon: "iconfont icon-nianqia-yibiaotaiqingxi"
      },
      children: DataManagement
    },
    {
      path: "/systemManagement",
      component: ContainerBackstage,
      show: true,
      list: true,
      meta: {
        title: "系统管理",
        roles: ["admin"],
        icon: "iconfont icon-qita"
      },
      children: SystemManagement
    },
    {
      path: "/manufacturerEquipment",
      component: ContainerBackstage,
      show: true,
      list: true,
      meta: {
        title: "厂家设备",
        roles: ["admin"],
        icon: "iconfont icon-rizhi"
      },
      children: EquipmentMaintenance
    },
    {
      path: "/equipmentMaintenance",
      component: ContainerBackstage,
      show: true,
      list: true,
      meta: {
        title: "维护记录",
        roles: ["admin"],
        icon: "iconfont icon-rizhi"
      },
      children: EquipmentMaintenance
    },
    {
      path: "/login",
      component: Login,
      show: false,
      meta: {
        title: "登录页"
      }
    },
    {
      path: "/404",
      component: Page404,
      hidden: false
    },
    {
      path: "*",
      redirect: "/404",
      // component: Page404,
      show: false
    }
  ]
});
